package com.netty.rpc.consumer;

import com.netty.rpc.protocol.RpcInvokerProxy;

import java.lang.reflect.Proxy;

/**
 * <p>
 * </p>
 *
 * @author chenchaobiao
 * @date 2022/5/7 15:05
 * @since 1.0.0
 */
public class RpcClientProxy {

    public <T> T clientProxy(final Class<T> interfaceCls,final String host,final int port){
        return (T) Proxy.newProxyInstance
                (interfaceCls.getClassLoader(),
                        new Class<?>[]{interfaceCls},
                        new RpcInvokerProxy(host,port));
    }
}